<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
    <script>
        $(function(){
            let jDiv = $("div")
            console.log("页面中所有的div",jDiv)

            let jSpan = $(".cSpan")
            console.log("最外面的spqn", jSpan)

            let span3 = $(".cDiv1 span")
            console.log("cDiv1中的span3", span3)

            let divContainer = $("div:contains('John')")
            console.log("内容是John",divContainer)

            let jDivF = $("div:first")
            console.log("第一个div",jDivF)

            let jDivF2 = $("div").first()
            console.log("第一个div 使用first()",jDivF2)
        })
    </script>
</head>
<body>

    <div class="cDiv">div1</div>
    <div class="cDiv">div2</div>
    <div class="cDiv">div3</div>
    <div class="cDiv1">div4
        <span>span3</span>
    </div>
    <div class="cDiv">div5
        <span>span1</span>
        <span>span2</span>
    </div>

    <span class="cSpan" >span</span>

    <div>John Resig</div>
    <div>George Martin</div>
    <div>Malcom John Sinclair</div>
    <div>J. Ohn</div>
</body>
</html>